CFLAGS = -g
objects = main.o coms.o events.o threadPool.o utils.o

server: $(objects)
	g++ $(CFLAGS) -o server $(objects) -lpthread -lmysqlclient

main.o: main.cpp
	g++ $(CFLAGS) -c $^

events.o: events.cpp
	g++ $(CFLAGS) -c $^

threadPool.o: threadPool.cpp
	g++ $(CFLAGS) -c $^

utils.o: utils.cpp
	g++ $(CFLAGS) -c $^

coms.o: coms.cpp
	g++ $(CFLAGS) -c $^

.PHONY: clean
clean:
	rm -f server $(objects) *.gch
cgch:
	rm -f *.gch
